]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Don't pass null to ClutterActor.disconnect()
authorAdel Gadllah <adel.gadllah@gmail.com>
Mon, 28 Feb 2011 21:34:19 +0000 (22:34 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 28 Feb 2011 21:41:11 +0000 (22:41 +0100)
_ungrabActor disconnects the event signal handler but does not
check whether it is connected before doing so which can result into
an exception like:

JS ERROR: !!!   Exception was: Error: disconnect() takes one arg, the signal handler id
JS ERROR: !!!     lineNumber = '0'
JS ERROR: !!!     fileName = 'gjs_throw'
JS ERROR: !!!     stack = 'Error("disconnect() takes one arg, the signal handler id")@:0

js/ui/dnd.js

index 021cb2eb3c2b28149f03f56a2ecaa07927a4caca..61776da913ec86d9c2c2d4f1b32353484a121978 100644 (file)
@@ -144,6 +144,8 @@ _Draggable.prototype = {
 
     _ungrabActor: function() {
         Clutter.ungrab_pointer();
+        if (!this._onEventId)
+            return;
         this.actor.disconnect(this._onEventId);
         this._onEventId = null;
     },